Skip to content

Conversation

mask-pp
Copy link
Contributor

@mask-pp mask-pp commented Apr 22, 2025

  1. Fix the error return format.
    todo: bindtype needs more complex logic to fix it.
    if err != nil { return nil, err } if err == nil { return obj, nil }
  2. Return pointer type object to avoid copying the whole struct content.
  3. Give the panic decision to the user.
  4. Fix empty line at the end of function.

TODO: fix some related test cases.

@mask-pp
Copy link
Contributor Author

mask-pp commented Apr 22, 2025

@MariusVanDerWijden If these changes make sense, then I will fix the related test cases.

Copy link
Member

@MariusVanDerWijden MariusVanDerWijden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I agree with @mask-pp that we shouldn't have panic'd on Pack, but this is a good workaround imo

@fjl fjl changed the title accounts/bind/v2: Some upgrades about abigen v2 accounts/bind/v2: generate TryPack* methods Apr 24, 2025
@jwasinger jwasinger changed the title accounts/bind/v2: generate TryPack* methods accounts/abi: generate TryPack* methods for abigen v2 bindings Jul 2, 2025
@jwasinger jwasinger merged commit bc67e7d into ethereum:master Jul 2, 2025
2 checks passed
howjmay pushed a commit to iotaledger/go-ethereum that referenced this pull request Aug 27, 2025
…eum#31692)

1. Fix the error return format.
**todo**: ~~`bindtype` needs more complex logic to fix it.~~
`
if err != nil {
  return nil, err
}
if err == nil {
  return obj, nil
}
`
2. ~~Return pointer type object to avoid copying the whole struct
content.~~
3. Give the panic decision to the user.
4. Fix empty line at the end of function.

**TODO**: ~~fix some related test cases.~~

---------

Co-authored-by: Jared Wasinger <j-wasinger@hotmail.com>
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Sep 3, 2025
…um#31692

1. Fix the error return format.
**todo**: ~~`bindtype` needs more complex logic to fix it.~~
`
if err != nil {
  return nil, err
}
if err == nil {
  return obj, nil
}
`
2. ~~Return pointer type object to avoid copying the whole struct
content.~~
3. Give the panic decision to the user.
4. Fix empty line at the end of function.

**TODO**: ~~fix some related test cases.~~

---------

Co-authored-by: Jared Wasinger <j-wasinger@hotmail.com>
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Sep 8, 2025
…um#31692

1. Fix the error return format.
**todo**: ~~`bindtype` needs more complex logic to fix it.~~
`
if err != nil {
  return nil, err
}
if err == nil {
  return obj, nil
}
`
2. ~~Return pointer type object to avoid copying the whole struct
content.~~
3. Give the panic decision to the user.
4. Fix empty line at the end of function.

**TODO**: ~~fix some related test cases.~~

---------

Co-authored-by: Jared Wasinger <j-wasinger@hotmail.com>
gballet pushed a commit to gballet/go-ethereum that referenced this pull request Sep 11, 2025
…eum#31692)

1. Fix the error return format.
**todo**: ~~`bindtype` needs more complex logic to fix it.~~
`
if err != nil {
  return nil, err
}
if err == nil {
  return obj, nil
}
`
2. ~~Return pointer type object to avoid copying the whole struct
content.~~
3. Give the panic decision to the user.
4. Fix empty line at the end of function.

**TODO**: ~~fix some related test cases.~~

---------

Co-authored-by: Jared Wasinger <j-wasinger@hotmail.com>
gzliudan added a commit to XinFinOrg/XDPoSChain that referenced this pull request Sep 17, 2025
…um#31692 (#1424)

1. Fix the error return format.
**todo**: ~~`bindtype` needs more complex logic to fix it.~~
`
if err != nil {
  return nil, err
}
if err == nil {
  return obj, nil
}
`
2. ~~Return pointer type object to avoid copying the whole struct
content.~~
3. Give the panic decision to the user.
4. Fix empty line at the end of function.

**TODO**: ~~fix some related test cases.~~

---------

Co-authored-by: maskpp <maskpp266@gmail.com>
Co-authored-by: Jared Wasinger <j-wasinger@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants